/**
 * 
 */
package model;


import java.io.IOException;



/**
 * @author kambo
 * 
 */
public class DiagnosisStat {

	private XLSReader xlsReader;
	private String [] coloumInfo = null;
	private String entry = null;
	private ReadWriter writer;
	private String outputFile;
	
	public DiagnosisStat(XLSReader r,String outputFile) {
		this.xlsReader = r;
		this.outputFile = outputFile;
	}
	
	public String[] getColoum(int coloumNummber) {
		return coloumInfo = xlsReader.convertCellArraytoStringArray(xlsReader.getColumnArray(coloumNummber));	
	}	
	
	public String toString(){
		 
		for( int i = 0; i < coloumInfo.length; i ++) {
			entry = entry + coloumInfo[i] + "\n";
		}	
		return entry;
	}
	
	
	
	public void printFile() {
		System.out.print(toString());
	}
	
	
	public void writeToFile() {
		writer = new ReadWriter(outputFile, toString());
		try {
			writer.writeFile();
		} catch (IOException e) {
			System.out.println("Fail!");
			e.printStackTrace();
		}
	}
	

	
}
